package com.jp.kefu.web.message;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import java.util.Date;

/**
 * @author lijin
 */
public abstract class AbstractMessage {

    public  enum MsgType{
	   text, location, link, image, voice, video, shortvideo, event;
    }
    //开发者微信号
    private String ToUserName;
    //发送方帐号（一个OpenID）
    private String FromUserName;
    //消息创建时间 （整型）
    private Long CreateTime;
    //消息类型
    private AbstractMessage.MsgType MsgType;


    public AbstractMessage(){}
    public AbstractMessage(String toUserName, String fromUserName, AbstractMessage.MsgType msgType){
	   this(toUserName, fromUserName, new Date().getTime(),msgType);
    }
    public AbstractMessage(String toUserName, String fromUserName, Long createTime, AbstractMessage.MsgType msgType ) {
	   ToUserName = toUserName;
	   FromUserName = fromUserName;
	   CreateTime = createTime;
	   MsgType = msgType;
    }

    public String getToUserName() {
	   return ToUserName;
    }

    public void setToUserName(String toUserName) {
	   ToUserName = toUserName;
    }

    public String getFromUserName() {
	   return FromUserName;
    }

    public void setFromUserName(String fromUserName) {
	   FromUserName = fromUserName;
    }

    public Long getCreateTime() {
	   return CreateTime;
    }

    public void setCreateTime(Long createTime) {
	   CreateTime = createTime;
    }

    public AbstractMessage.MsgType getMsgType() {
	   return MsgType;
    }

    public void setMsgType(AbstractMessage.MsgType msgType) {
	   MsgType = msgType;
    }


    @Override
    public String toString() {
	   return ReflectionToStringBuilder.toString(this);

    }
}
